﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Mappings;

namespace Apollo.Modules.Commissioning
{
    [NHibernateEntity(Table = "CommissionCalculations", Lazy = true)]
    public class CommissionCalculation
    {
        public CommissionCalculation() { }

        [PrimaryKey]
        public virtual int Id { get; set; }

        [Property]
        public virtual string Name { get; set; }

        [Property]
        public virtual DateTime CalculationDate { get; set; }

        [Property]
        public virtual DateTime AllocationStartDate { get; set; }

        [Property]
        public virtual DateTime AllocationEndDate { get; set; }

        [Property]
        public virtual DateTime PaymentEndDate { get; set; }

        [Property]
        public virtual DateTime TimeTableItemEndDate { get; set; }

        [Property]
        public virtual string CalculationReason { get; set; }

        [Property]
        public virtual CommissionCalculationState State { get; set; }

        [BelongsTo(Column = "ID_Prev_CommissionCalculation")]
        public virtual CommissionCalculation Prev { get; set; }
    }

    public enum CommissionCalculationState { 
        None = 1,
        Validated = 2,
        Locked = 3,
        Test = 10
    }
}
